window.onload = function() {

	oBtn = document.getElementsByTagName('button')[0];
	oDiv = document.getElementsByClassName('menu')[0];

	oBtn.addEventListener('click', showMenu, false);
	document.addEventListener('click', hideMenu, false);

};

var oBtn = null;
var oDiv = null;

function showMenu(ev) {
	ev = ev || event;
	ev.cancelBubble = true;
	oDiv.style.display = 'block';
}

function hideMenu() {
	oDiv.style.display = 'none';
}
